/*
 * Copyright (c) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import router from '@system.router'
import TitleBarParams from '../../../share/common/components/titleBar/TitleBarParams';
import {TYPE_SERVICES, TYPE_DEVICES, SHOW_SERVICES_COUNT, SHOW_DEVICES_COUNT
} from '../../../share/common/components/featuredCard/FeaturedCard.js';

export default {
  data: {
    data: [],
    type: TYPE_DEVICES,
  },
  onInit() {
    if (this.type == TYPE_SERVICES) {
      this.columnsNum = SHOW_SERVICES_COUNT
      this.width = '164px'
      this.height = '164px'
      this.title = 'strings.public_more_service'
    } else {
      this.columnsNum = SHOW_DEVICES_COUNT
      this.width = '76px'
      this.height = '76px'
      this.title = 'strings.public_devices_recommendation'
    }
    this.titleBarConfig = TitleBarParams.getTitleBarConfig(
      {
        title: this.$t(this.title)
      });
  },
  back: function () {
    router.back();
  }
}